<template>
	<view class="top">
		<view class="time">
			<div class="time_tit">
				<div class="step"></div> &nbsp;&nbsp;{{crun_obj.add_time.slice(5,10)}}
			</div>
			<div class="time_con">
				<div class="left">
					<img src="../static/my/userH.png" alt="" class="img" @click="goMy(crun_obj.author)" />
				</div>
				<div class="con">
					<p class="p1">
						{{crun_obj.author}} <view class="mm">
							销售经理
						</view>
					</p>
					<p class="p2">
						发起工单 工单标题 处理人员：{{crun_author}}
					</p>
					<p class="p3">
						<img src="../../static/tixk/xnxitixk/shijian.png" alt="" class="img1" />
						<p class="mn">{{crun_obj.add_time.slice(0,16)}}</p>
					</p>
				</div>
				<div class="right">
					工单
				</div>
			</div>
		</view>
		<view class="time">
			<div class="time_tit">
				<div class="step"></div> &nbsp;&nbsp;{{crun_obj.add_time.slice(5,10)}}
			</div>
			<div class="time_con">
				<div class="left">
					<img src="../static/my/userH.png" alt="" class="img" />
				</div>
				<div class="con">
					<p class="p1">
						赵小刚 <view class="mm">
							销售经理
						</view>
					</p>
					<p class="p2">
						发起工单 工单标题 处理人员：{{crun_author}}
					</p>
					<p class="p3">
						<img src="../../static/tixk/xnxitixk/shijian.png" alt="" class="img1" />
						<p class="mn">{{crun_obj.add_time.slice(0,16)}}</p>
					</p>
				</div>
				<div class="right">
					工单
				</div>
			</div>
		</view>
		<view class="time">
			<div class="time_tit">
				<div class="step"></div> &nbsp;&nbsp;{{crun_obj.add_time.slice(5,10)}}
			</div>
			<div class="time_con">
				<div class="left">
					<img src="../static/my/userH.png" alt="" class="img" />
				</div>
				<div class="con">
					<p class="p1">
						{{crun_obj.author}} <view class="mm">
							销售经理
						</view>
					</p>
					<p class="p2">
						发起工单 工单标题 处理人员：{{crun_author}}
					</p>
					<p class="p3">
						<img src="../../static/tixk/xnxitixk/shijian.png" alt="" class="img1" />
						<p class="mn">{{crun_obj.add_time.slice(0,16)}}</p>
					</p>
				</div>
				<div class="right">
					工单
				</div>
			</div>
		</view>
		<view class="time">
			<div class="time_tit">
				<div class="step"></div> &nbsp;&nbsp;{{crun_obj.add_time.slice(5,10)}}
			</div>
			<div class="time_con">
				<div class="left">
					<img src="../static/my/userH.png" alt="" class="img" />
				</div>
				<div class="con">
					<p class="p1">
						{{crun_obj.author}} <view class="mm">
							销售经理
						</view>
					</p>
					<p class="p2">
						发起工单 工单标题 处理人员：{{crun_author}}
					</p>
					<p class="p3">
						<img src="../../static/tixk/xnxitixk/shijian.png" alt="" class="img1" />
						<p class="mn">{{crun_obj.add_time.slice(0,16)}}</p>
					</p>
				</div>
				<div class="right">
					工单
				</div>
			</div>
		</view>
	</view>
</template>

<script>
	export default {
		name:"crunch_bot",
		props:{
			crun_author:{
				type: String,
				required: true,
			},
			crun_obj:{
				type: Object,
				required:true,
			}
		},
		data() {
			return {
				obj:{}
			};
		},
		methods:{
			goMy(name){
				console.log(name)
				uni.request({
					url: 'http://localhost:3000/getData',
					method: 'POST',
					data: {
						// 请求参数
					},
					header: {
						// 请求头
						'content-type': 'application/json'
					},
					success: function(res) {
						console.log('请求成功', res.data);
						const {
							data
						} = res.data
						const nos = data.filter(item=>{
							if(item.name === name){
								return item
							}
						})
						console.log(nos[0])
						wx.navigateTo({
							url:`/pages/my/gerf/gerf?data=${JSON.stringify(nos[0])}`
						})
						
						
						
						// 处理返回的数据
					},
					fail: function(err) {
						console.log('请求失败', err);
						// 处理请求失败
					}
				});
				// wx.navigateTo({
				// 	url:`/pages/my/gerf/gerf?data=${JSON.stringify(this.obj)}`
				// })
				
			}
		}
	}
</script>

<style scoped lang="scss">
	.img{
		width: 80rpx;
		height: 80rpx;
		border-radius: 50%;
	}
	.img1{
		width: 30rpx;
		height: 30rpx;
	}
	.top{
		width: 100%;
		height: 100%;
		background-color: #f9f9f9;
		font-size: 25rpx;
		.time{
			width: 100%;
			padding: 0px 20rpx;
			.time_tit{
				display: flex;
				align-items: center;
				padding: 40rpx 20rpx;
			}
			.time_con{
				display: flex;
				padding: 20rpx 0rpx;
				// align-items: center;
				background-color: #ffffff;
				border-radius: 20rpx;
				box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
				// padding: 0px ;
				.p1{
					margin: 20rpx 0rpx;
					display: flex;
					// margin-right: 10rpx;
					.mm{
						margin-left: 10rpx;
						font-size: 20rpx;
						color: #999999;
						margin-top: 5rpx;
					}
				}
				.p3{
					margin-top: 20rpx;
					display: flex;
					color: #99a6c4;
					align-items: center;
				}
				.left{
					margin: 10rpx 10rpx;
				}
				.right{
					text-align: right;
					flex: 1;
					padding: 20rpx 20rpx;
				}
			}
		}
	}
	.step {
	// margin-top: 20rpx;
	  width: 25rpx;
	  height: 25rpx;
	  border-radius: 50%;
	  // background-color: #1684fd;
	  color: white;
	  text-align: center;
	  line-height: 30px;
	  border: 6rpx solid #1684fd;
	}

</style>